$(function(){
    $("#submit").on("click",function(){
        var aler = $(".aler");
        var text2 = $("#text2").val();
        var paws = $("#paws").val();
        var email = $("#email").val()
            $.post("http://47.104.244.134:8080/usersave.do",{"username":text2,"password":paws,"email":email,"sex":"男"},function(data){
                console.log(data);
                $(".kun1").css("display","none");
            })            
        if(text2.length<=3 && paws.length<=3){
            $(".kun1").css("display","block");
            location.href="javascript:;"
        };
        if(text2.length>=4 || paws.length>=4){
            var index = 3;
           aler.css("display","block")
            function timer() {
                var seti = document.getElementById("seti");
                seti.innerHTML = index;
                index--
                if (index <= 0) {
                    index = 0;
                    clearInterval(timer);
                    window.location.href='http://localhost:8080/login.html';
                }
            } setInterval(timer, 1000)
        }
        }
    )
    $("#text2").on("focus",function(){
        $(".kun1").css("display","none");
        });
    });